﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
namespace CMSModel
{
    /// <summary>
    /// 用户表
    /// </summary>
    public class User
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        public string Username { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string Nickname { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }
        /// <summary>
        /// 登录次数
        /// </summary>
        public int LoginCount { get; set; }
        /// <summary>
        /// 阅读次数
        /// </summary>
        public int ReadCount { get; set; }
        /// <summary>
        /// 回复次数
        /// </summary>
        public int ReplyCount { get; set; }
        /// <summary>
        /// 分享次数
        /// </summary>
        public int ShareCount { get; set; }
        /// <summary>
        /// 用户来源 Source的枚举值
        /// </summary>
        public int Source { get; set; }
        /// <summary>
        /// 小红花
        /// </summary>
        public int Flower { get; set; }
        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime Pdate { get; set; }
        /// <summary>
        /// 用户状态 正常，禁言，限制登录，删除 State的枚举值
        /// </summary>
        public int State { get; set; }
        /// <summary>
        /// 用户可以登录后台的权限 ManagerLevel的枚举值
        /// </summary>
        public int ManagerLevel { get; set; }

        public User()
        {
            this.Flower = int.MinValue;
            this.Id = int.MinValue;
            this.LoginCount = int.MinValue;
            this.ManagerLevel = int.MinValue;
            this.ReadCount = int.MinValue;
            this.ReplyCount = int.MinValue;
            this.ShareCount = int.MinValue;
            this.Source = int.MinValue;
            this.State = int.MinValue;
        }
    }
    /// <summary>
    /// 用户来源
    /// </summary>
    public enum Source
    {
        /// <summary>
        /// 网址注册用户
        /// </summary>
        Web = 1,
        /// <summary>
        /// QQ应用用户
        /// </summary>
        QQ = 2
    }
    /// <summary>
    /// 用户状态
    /// </summary>
    public enum State
    {
        /// <summary>
        /// 正常
        /// </summary>
        Normal = 1,
        /// <summary>
        /// 禁言
        /// </summary>
        Gag = 2,
        /// <summary>
        /// 限制登录
        /// </summary>
        LimitLogin = 3,
        /// <summary>
        /// 已被删除
        /// </summary>
        Deleted = 4
    }
    /// <summary>
    /// 管理级别
    /// </summary>
    public enum ManagerLevel
    {
        /// <summary>
        /// 不能登录后台
        /// </summary>
        CannotLogin = 0,
        /// <summary>
        /// 可以在后台发表文章
        /// </summary>
        ManagerDoc = 1,
        /// <summary>
        /// 可以管理所有
        /// </summary>
        ManagerAll = 2
    }
}
